<?php
session_start();
if(isset($_SESSION['lang']))
    require_once "./language_files/save_template_" . $_SESSION['lang'] . ".php";
else
    require_once "./language_files/save_template_en.php";
require_once "functions.php";
$id=$_SESSION['member_id'];
require_once 'statics.php';
if(isset($_POST['temp_text']) && $_POST['temp_text'] != NULL && isset($_POST['name']) && $_POST['name'] != NULL && $_POST['name'] != NULL
        && isset($_POST['subject_text']) && $_POST['subject_text'] != NULL)
{
    $temp_text=mysql_real_escape_string($_POST['temp_text']);
    $subject_text=mysql_real_escape_string($_POST['subject_text']);
    $name=mysql_real_escape_string($_POST['name']);
    iInsert("message_templates",array("member_id"=>$id,"template_text"=>$temp_text,"template_name"=>$name,"subject_text"=>$subject_text));
    echo '1';
}
else
{
    echo $lang['error_1'];
}
?>
